Matlab Codes

Chapter 3

Matlab code 3.5: Matlab file “Figure 3-16.m”

%--------------------------------------------------------------------

% This code can be used to generate Figure 3.16

%--------------------------------------------------------------------

 

clear all;

close all;

%% m-D frequency curve

c = 3e8;

j = sqrt(-1);

f0 = 10e9; % carrier frequency

B = 300e6; % bandwidth

tr = 0.78125e-4; % subpulse repetition interval

t1 = tr/2.5; % time duration of subpulse

df = 4.6875e6; % subpulse frequency increment

N = 64; % number of subpulses in a burst

B1 = df; % bandwidth of the subpulse

mu = B1/t1; % frequency modulation rate

dr = 0.5; % range resolution

rq = -3; % distance between the center of rotation and reference point

Rref = 5000; % distance between the reference point and radar

rr = 2; % radius of rotation

fr = [2;5]; % rotational frequency(Figure 3.16(a))

% fr = [2;8]; % Figure 3.16(b)

omega = 2*pi*fr; % angular frequency of rotation

thet0 = pi*[1/2 1/2]; % initial phase of subpulse

t = 1; % radar illumimated time

brf = 600; % burst repetition frequency

bri = 1/brf; % burst repetition interval

tm = 0:bri:t-bri; % slow time sampling interval

m = length(tm);

rtm = zeros(length(omega),m); % distance between the scatterers and radar

for i = 1:m

    for k = 1:length(omega)

        phi(k) = acos(1/sqrt(1+omega(k).^2*f0^2*tr^2/df^2));

        rtm(k,i) = Rref+rq+sqrt(1+omega(k).^2*f0^2*tr^2/df^2)*cos(omega(k)*tm(i)+thet0(k)+phi(k));

    end

end   

 

%% simulation

rmax = Rref+rq+2*rr; % the maximum detectable distance

rmin = Rref+rq-2*rr; % the minmum detectable distance

tp = N*tr; % pulse duration

ts = rmin/c; % the starting point of the time sampling

te = rmax/c+t1; % the ending point of the time sampling

kdt = 1/B1; % fast time sampling interval

nt = 2*ceil((te-ts)/(2*kdt)); % number of fast time sampling

tk = ts+kdt*(0:nt-1); % fast time

rtma = sqrt(rtm.^2); % distance between the scatterers and radar

s = zeros(nt,m*N); % echo signal matrix

s0 = zeros(nt,m*N); % reference signal

for n = 1:m

    for i = 1:N

        for k = 1:length(omega)

            td = tk(:)-i*tr-2*rtma(k,n)/c;

            s(:,(n-1)*N+i) = s(:,(n-1)*N+i)+exp(j*2*pi*(f0+i*df)*td+thet0(k)+j*pi*mu*td.^2);

        end

        td0 = tk(:)-i*tr-2*Rref/c;

        s0(:,(n-1)*N+i) = s0(:,(n-1)*N+i)+exp(j*2*pi*(f0+i*df)*td0+j*pi*mu*td0.^2);    

    end

end

sdt = s.*conj(s0); % dechirp

sdf = fftshift(fft(sdt),1);

snm = sdf(nt/2+1,:);

shrc = zeros(N,m);

for i = 1:m

    shrc(:,i) = (snm((i-1)*N+1:i*N))';

end

shrp = fftshift(fft(shrc),1);

figure(2)

x = (1:m)*bri;

y = -(-N/2+1:N/2)*c/(2*N*df);

contour(x,y,abs(shrp),20)

xlabel('Slow time (s)')

ylabel('Range (m)')

axis([0,1,-15,15])